﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action
{
	public class ActionReturnedScout : Action
	{
		public static ActionReturnedScout Instance = new ActionReturnedScout();

		private ActionReturnedScout() { }
		public override bool CanExecute(IBuildOrder bo) { return bo.State.ScoutsSent > 0; }
		public override bool HaveResources(IBuildOrder bo) { return bo.State.ScoutsSent > 0; }
		public override bool HaveTechnology(IBuildOrder bo) { return true; }
		public override bool IsInvalid(IBuildOrder bo) { return bo.State.ScoutsSent == 0; }
		public override void Execute(IBuildOrder bo)
		{
			bo.State.ScoutsSent--;
			bo.State.WorkersOnMinerals++;
		}
	}
}
